/**
 * Created by raymondteng on 6/15/14.
 */
public class TriangleExercises {

    public static void main(String[] args) {
        printOneStar();
        System.out.println("-------------------------------");
        printNStarsOnSameLine(8);
        System.out.println("-------------------------------");
        printNStarsVertically(3);
        System.out.println("-------------------------------");
        printRightTriangleWithBaseN(3);
        System.out.println("-------------------------------");

    }

    private static void printRightTriangleWithBaseN(int n) {
        String start =  "";
        for(int i = 0; i < n; i++){
            start += "*";
            System.out.println(start);
        }
    }

    private static void printNStarsVertically(int n) {
        for(int i = 0; i < n; i++){
            System.out.println("*");
        }
    }

    private static void printNStarsOnSameLine(int n) {
        for(int i = 0; i < n; i++){
            System.out.print("*");
        }
        System.out.println();
    }

    public static void printOneStar() {
        System.out.println("*");
    }
}
